/**/


#include <stdio.h>
#include <math.h>

int reverse(int x) {
    int iTmp = x;
	int ibit;
	char bNointer;
	char cTmpNum[16] = {0};
	char i, j, k;
	
	bNointer = x>0 ? 1:0;

	for(i = 0; iTmp != 0;)
	{
		cTmpNum[i] = iTmp % 10;
		if(cTmpNum[i] < 0)
			cTmpNum[i] = -cTmpNum[i];
		iTmp /= 10;
		if(cTmpNum[0] != 0)
			i++;
	}
	iTmp = 0;
	k = i;
	for(j = 0; j < i; j++)
		printf("%d\n", cTmpNum[j]);
	for(i = 0; i < k; i++)
	{
		ibit = 1;
		for(j = 0; j < k-i-1; j++)
			ibit *= 10;
		if((k-i-1 >= 8) && (cTmpNum[i] > 2))
			return 0;
		printf("%d\n", ibit);
		iTmp += cTmpNum[i] * ibit;
		printf("%d\n", iTmp);
	}
	if(iTmp < 0)
		return 0;
	if(!bNointer)
		return -iTmp;
	return iTmp;
}

int main(void)
{
	int n;
	n = -2147483648;
	printf("%d\n", reverse(n));
	return 0;
}